feat: Anthropic distill support (llm.api=anthropic-messages)#399
feat: Anthropic distill support (llm.api=anthropic-messages)#399Coke1120 wants to merge 4 commits intoCortexReach:masterfrom
Conversation
|
Anthropic client implementation looks good — endpoint normalization, content block parsing, and JSON repair all handled correctly. This PR includes all changes from #398 (Bitwarden secret resolver) — stacked PRs. #398 needs to merge first, then this PR's diff will be just the Anthropic additions. Will review/approve once #398 lands. |
AliceLJY
left a comment
There was a problem hiding this comment.
Thanks for the Anthropic distill support! Two things to sort out before merging:
-
Merge order dependency: This PR references
resolveSecretValuefromsecret-resolver.ts, which is introduced in #398. If #398 hasn't merged yet, this PR won't compile standalone. Please confirm the intended merge order, or rebase on top of #398 once it's in. -
Test checklist: The PR body has several test items still unchecked (
test/llm-api-key-client.test.mjsetc.). Could you confirm all tests are passing and update the checklist?
Once those are clear, happy to approve!
Add createAnthropicApiKeyClient to src/llm-client.ts supporting the Anthropic /v1/messages API format via llm.api=anthropic-messages. Add llm.api and llm.anthropicVersion config fields to index.ts, cli.ts, and openclaw.plugin.json. Add examples/new-session-distill/ with a worker demonstrating Anthropic-based lesson extraction. Add test/llm-api-key-client.test.mjs and update plugin-manifest-regression to assert the new schema fields. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
With async register() now awaited, selfImprovement defaults to enabled and registers command:new before the sessionMemory assertion runs. Explicitly disable it in the base test config to isolate the assertion. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…fest test configs Lost during rebase onto master. selfImprovement now defaults to enabled, so these test configs need it explicitly disabled to isolate command:new assertions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d44b00f to
bcc1567
Compare
Summary
createAnthropicApiKeyClienttosrc/llm-client.tssupporting Anthropic/v1/messagesAPI viallm.api=anthropic-messagesllm.apiandllm.anthropicVersionconfig fields toindex.ts,cli.ts, andopenclaw.plugin.jsonexamples/new-session-distill/with a worker demonstrating Anthropic-based lesson extractiontest/llm-api-key-client.test.mjsand updateplugin-manifest-regressionto assert new schema fieldsREADME.mdMerge order
Must merge #398 first. This PR imports
resolveSecretValuefromsrc/secret-resolver.tswhich is introduced in #398. It will not compile standalone.Test plan
node --test test/llm-api-key-client.test.mjs— verify Anthropic client key handlingnode test/plugin-manifest-regression.mjs— verify manifest schema declaresllm.apiandllm.anthropicVersionnpm test— full test suite passesexamples/new-session-distill/with a real session (requires live Anthropic API key)Split from #349.
🤖 Generated with Claude Code